<?php

namespace App\Admin\Actions\Grid\Row\SwtMachine;

use App\Admin\Forms\SelectedMerchantForm;
use Dcat\Admin\Grid\RowAction;
use Dcat\Admin\Widgets\Modal;

class MachineBindMerchant extends RowAction
{
    protected $title = '商户';
    public function render()
    {
        $form = SelectedMerchantForm::make()->payload(['id' => $this->getKey()]);

        $title = '商户 - '. $this->row->machine_no;

        $button = <<<HTML
            <a><i class="feather icon-user-plus text-warning"></i> <span class="text-warning">{$this -> title}</span> &emsp;</a>
        HTML;

        return Modal::make()
            ->lg()
            ->title($title)
            ->body($form)
            ->button($button);
    }
}
